/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sonth.Utils;

import java.sql.Connection;
import java.sql.DriverManager;

/**
 *
 * @author Administrator
 */
public final class JdbcConnector {

    /**
     * desc.
     */
    private static String driverDB =
            "com.microsoft.sqlserver.jdbc.SQLServerDriver";
    /**
     * desc.
     */
    private static String urlDB =
            "jdbc:sqlserver://127.0.0.1:1434;databaseName=SDP";
    /**
     * desc.
     */
    private static String userDB = "sa";
    /**
     * desc.
     */
    private static String passDB = "123456";

    /**
     * desc.
     */
    private JdbcConnector() {
    }

    /**
     * desc.
     * @return Connection desc
     */
    public static Connection open() throws Exception {
        Class.forName(driverDB);
        Connection con = DriverManager.getConnection(urlDB, userDB, passDB);
        return con;
    }

    /**
     * desc.
     * @param con desc
     */
    public static void close(final Connection con) throws Exception {
        con.close();
    }
}
